← Back
Editing: traffic-legacy.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return n};var r,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(r){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new G(n||[]);return a(i,"_invoke",{value:k(t,r,u)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function x(){}var _={};f(_,l,(function(){return this}));var j=Object.getPrototypeOf,L=j&&j(j(C([])));L&&L!==o&&i.call(L,l)&&(_=L);var E=x.prototype=b.prototype=Object.create(_);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(e,r){function n(o,a,u,l){var c=h(e[o],e,a);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==t(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,l)}),(function(t){n("throw",t,u,l)})):r.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return n("throw",t,u,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function k(t,e,n){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var l=P(u,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=h(t,e,n);if("normal"===c.type){if(o=n.done?m:v,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function P(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,P(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function t(){for(;++o<e.length;)if(i.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return a.next=a}}throw new TypeError(t(e)+" is not iterable")}return w.prototype=x,a(E,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(E),t},n.awrap=function(t){return{__await:t}},S(O.prototype),f(O.prototype,c,(function(){return this})),n.AsyncIterator=O,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new O(p(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(E),f(E,s,"Generator"),f(E,l,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=C,G.prototype={constructor:G,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return u.type="throw",u.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function r(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}System.register(["./index-legacy131.js?v=1765440387","./utils-lib-legacy.js?v=1765440387","./base-lib-legacy.js?v=1765440387","./useStore-legacy4.js?v=1765440387","./useController-legacy13.js?v=1765440387","./index-legacy105.js?v=1765440387","./validator-legacy.js?v=1765440387","./column-legacy.js?v=1765440387","./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang-legacy.js?v=1765440387","./__commonjsHelpers__-legacy.js?v=1765440387","./site-legacy.js?v=1765440387","./useController-legacy6.js?v=1765440387","./config-legacy.js?v=1765440387"],(function(t,o){"use strict";var i,a,u,l,c,s,f,p,h,y,v,d,m,g,b,w,x,_,j,L,E,S,O,k,P,A,I;return{setters:[function(t){i=t._},function(t){a=t.G,u=t.bw,l=t.k},function(t){c=t.c,s=t.g,f=t.e,p=t.T,h=t.B,y=t.D,v=t.q,d=t.v,m=t.x,g=t.M,b=t.A,w=t.z,x=t.C,_=t.J},function(t){j=t.u,L=t.S},function(t){E=t.i,S=t.h,O=t.p,k=t.o,P=t.m,A=t.b,I=t.a},null,null,null,null,null,null,null,null],execute:function(){t("default",c({__name:"traffic",setup:function(t,o){var c=o.expose,G=j(),C=(G.isBindExtranet,G.siteInfo);L();var N,T,V=a({data:E,options:function(t){return s((function(){var e;return[{type:"custom",render:function(){return f(u,{label:"是否启用"},{default:function(){return[f(p,{modelValue:t.value.value,"onUpdate:modelValue":function(e){return t.value.value=e},onChange:function(e){return S(e,t.value)}},{default:function(){return[h("启用流量控制")]}})]}})}},{type:"select",label:"限制方案",key:"type",options:O.value,attrs:{style:"width: 24rem;",onChange:function(e){var r=O.value[e].items,n=r.perserver,o=r.perip,i=r.limit_rate;t.value.perserver=n,t.value.perip=o,t.value.limit_rate=i}}},{type:"custom",render:function(){return f(u,{label:"并发限制",prop:"perserver"},{default:function(){return[f(l,{modelValue:t.value.perserver,"onUpdate:modelValue":function(e){return t.value.perserver=e},type:"number",width:"24rem",class:"mr-1rem"},null),f("div",{class:"text-[#999] text-[1.2rem]"},[h("* 限制当前站点最大并发数")])]}})},rules:{perserver:[{required:!0,message:"请输入并发限制",trigger:"blur"},{validator:function(t,e,r){e>65535?r(new Error("不能大于65535")):r()}}]}},{type:"custom",render:function(){return f(u,{label:"单IP限制",prop:"perip"},{default:function(){return[f(l,{modelValue:t.value.perip,"onUpdate:modelValue":function(e){return t.value.perip=e},type:"number",width:"24rem",class:"mr-1rem"},null),f("span",{class:"text-[#999] text-[1.2rem]"},[h("* 限制单个IP访问最大并发数")])]}})},rules:{perip:[{required:!0,message:"请输入单IP限制",trigger:"blur"},{validator:function(t,e,r){e>65535?r(new Error("不能大于65535")):r()}}]}},{type:"custom",render:function(){return f(u,{label:"流量限制",prop:"limit_rate"},{default:function(){return[f(l,{modelValue:t.value.limit_rate,"onUpdate:modelValue":function(e){return t.value.limit_rate=e},type:"number",width:"24rem",class:"mr-1rem"},null),f("span",{class:"text-[#999] text-[1.2rem]"},[h("* 限制每个请求的流量上限(单位:KB)")])]}})},rules:{limit_rate:[{required:!0,message:"请输入流量限制",trigger:"blur"}]}}].concat(n(null!==(e=C.value)&&void 0!==e&&e.id?[{type:"custom",render:function(){return f(u,{label:" "},{default:function(){return[f(y,{type:"primary",onClick:U},{default:function(){return[t.value.value?"保存":"保存并启用"]}})]}})}}]:[]))}))},submit:(N=e().mark((function t(r,n){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:return t.next=4,k(r.value);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})),T=function(){var t=this,e=arguments;return new Promise((function(n,o){var i=N.apply(t,e);function a(t){r(i,n,o,a,u,"next",t)}function u(t){r(i,n,o,a,u,"throw",t)}a(void 0)}))},function(t,e){return T.apply(this,arguments)})}),F=V.BtForm,U=V.submit;return c({onConfirm:U}),function(t,e){var r=i;return v(),d("div",{class:_(["h-full",{"p-2rem":m(I)}])},[m(P)?(v(),g(r,{key:0,width:"36rem"},{content:b((function(){return[h(w(m(A)),1)]})),_:1})):x("",!0),f(m(F))],2)}}}))}}}))}();
Save File
Cancel